package nl.scalasim
package actors

import nl.scalasim.actors.traits._

/**
 * A Harvester that also provides housing for a number of citizens. 
 *
 * @author Yigal Duppen
 * @since Oct 7, 2010
 */
class Farm(val addressBook: AddressBook, override val descriptor: ActorDescriptor, val goods: Goods, val speed: Int, val capacity: Int, val maxResidents: Int, val maxWorkers: Int = 1)
        extends SimulationActor(descriptor)
                with StoppableActor
                with HousingActor
                with HarvestingActor
                with WorkplaceActor
{

  def handleAct: PartialFunction[Any, Unit] = {
    case Act => {
      advertise(addressBook.guildmaster)
      reply(Ack)
    }
  }
  callbacks :+= handleAct

}